<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui" xmlns="http://www.w3.org/1999/xhtml"
	xml:lang="en" lang="en"
	xmlns:fn="http://java.sun.com/jsp/jstl/functions"
	xmlns:c="http://java.sun.com/jsp/jstl/core">
<h:body>
	<ui:composition template="/protegido/main.xhtml">
		<ui:define name='conteudoPrincipal'>
			<h:outputScript library='javascripts'
				name="query.maskedinput-1.2.2.min.js" />
			<h:outputScript>
				$(document).ready(function() {
					$("#navigation li.disciplinasAdm a").addClass("active");
					$("#navigation li").parent().find('li').removeClass("active");
					if ($("#disciplinasAdm")){
						$("#disciplinasAdm").addClass("active");
					}
				});
			</h:outputScript>
			<style type="text/css" media="screen">
form {
	height: auto;
}

form .item-passos {
	font-size: 18px;
	margin-bottom: 15px;
	padding-bottom: 0px;
}

#campos-gerais {
	width: 28%;
	min-height: inherit;
	height: inherit;
	overflow: hidden;
	float: left;
	padding-right: 15px;
	margin-left: 15px;
	margin-bottom: 15px;
}

#campos-horario-local {
	width: 28%;
	min-height: inherit;
	margin-left: 30px;
	min-height: 415px;
	height: inherit;
	overflow: hidden;
	float: left;
	border-left: 1px solid #dfdfdf;
	padding-left: 20px;
	margin-right: 30px;
	margin-bottom: 15px;
}

#campos-especificos {
	width: 28%;
	min-height: inherit;
	margin-left: 0px;
	min-height: 415px;
	height: inherit;
	overflow: hidden;
	float: left;
	border-left: 1px solid #dfdfdf;
	padding-left: 20px;
	padding-right: 20px;
	margin-bottom: 15px;
}

form input[type="text"],form input[type="password"] {
	width: 230px;
}

form input.w30 {
	width: 30px;
}

form input.w80 {
	width: 75px;
}

form span {
	font-size: 10px;
	color: #666;
	margin-left: 5px;
}

form span a {
	font-size: 10px;
	font-weight: bold;
	color: red;
}

form input.w120 {
	width: 175px;
}

form .input-submit {
	text-align: right;
	margin-top: 30px;
}

.campo-form {
	margin-top: 5px;
	margin-left: 20px;
}

#statusAcessoUsu,#statusAcessoUsu * {
	border: none !important;
	padding: 0 !important;
	font-weight: normal;
}
</style>

			<div class="ui-widget">
				<h:messages id="msg"
					style="font-size: 12px; margin-top: 20px; margin-bottom: 20px; padding: 10px 0.7em;"
					class="ui-state-error ui-corner-all" />
			</div>

			<h2>Editar Disciplina</h2>
			<h:form id="editarDisciplinaAdmin" prependId="false">
				<div id="campos-gerais">
					<div class="item-passos">.: Dados Gerais</div>

					<div class="campo-form">
						<label for="nomedisciplina">Nome: *</label>
						<h:inputText type="text" name="nomeDisciplina" class="text"
							value="#{disciplinaMB.disciplina.nome}" id="nomeDisciplina"
							required="true" />
					</div>
					<div class="campo-form">
						<label for="ememta">Descrição / Ementa: </label><br />
						<h:inputTextarea name="ementa" class="text"
							value="#{disciplinaMB.disciplina.descricao}" id="ememta" />
					</div>
					<div class="campo-form">
						<label for="numVagas">Número Vagas: *</label><br /> <span>Valor
							Min.= 0</span> <br />
						<p:spinner id="numVagas" name="numVagas" min="0"
							style="margin-left:0px; margin-top:8px; text-align:left;"
							value="#{disciplinaMB.disciplina.numVagas}" />
					</div>
					<div class="campo-form">
						<label for="mediaAprovacao">Média Aprovação: *</label><br /> <span>Valor
							Min.= 0, Valor Max= 100</span> <br />
						<h:inputText type="text" name="mediaAprovacao" class="text"
							value="#{disciplinaMB.disciplina.mediaAprovacao}"
							id="mediaAprovacao" required="true" style="text-align:right;" />

						<p:slider for="mediaAprovacao"
							style="width:244px; margin-left:2px;" />

					</div>
				</div>
				<div id="campos-horario-local">
					<div class="item-passos">.: Horário e Local</div>
					<div class="campo-form">
						<label for="horario">Horário: </label><br /> <span>Exemplo:
							seg (7:00-9:15), ter (9:15-10:45) </span> <br />
						<h:inputTextarea id="horario" name="horario"
							value="#{disciplinaMB.disciplina.horario}" class="text" />
					</div>
					<div class="campo-form">
						<label for="local">Local: </label><br /> <span>Exemplo:
							seg (Lab 4), ter (Lab 3) </span> <br />
						<h:inputText type="text" name="local" class="text"
							value="#{disciplinaMB.disciplina.local}" id="local" />
					</div>
				</div>

				<div id="campos-especificos">
					<div class="item-passos">.: Dados Específicos</div>
					<div class="campo-form">
						<label for="semestre">Semestre: *</label><br /> <span>Exemplo:
							2012.1 </span> <br />
						<h:inputText type="text" name="semestre" class="text"
							value="#{disciplinaMB.disciplina.semestre}" id="semestre"  required="true"/>
					</div>
					
					<div class="campo-form">
						<label for="dataIni">Início das Aulas:*</label><br />
						<p:calendar effect="fadeIn" name="dataIni"
							value="#{disciplinaMB.disciplina.dtInicio}" id="dataIni" pattern="dd/MM/yyyy" required="true">
							<f:validator validatorId="dtInicioFimValidator" />
							<f:attribute name="dataFim" value="#{dataFim}" />
						</p:calendar>
					</div>

					<div class="campo-form">
						<label for="dataFim">Termino das Aulas:*</label><br />
						<p:calendar effect="fadeIn" name="dataFim"
							value="#{disciplinaMB.disciplina.dtFim}" id="dataFim"
							binding="#{dataFim}" pattern="dd/MM/yyyy" required="true"/>
					</div>



					<div class="campo-form">
						<label for="professor">Professor Ministrante: *</label><br />
						<h:selectOneMenu id="professor" name="professor"
							value="#{disciplinaMB.profMinistranteId}" class="select"
							required="true" style="width:100%;">
							<f:selectItems value="#{disciplinaMB.professores}" var="p"
								itemValue="#{p.id}" itemLabel="#{p.nome}" />
						</h:selectOneMenu>
					</div>
				</div>

				<div class="clearfix"></div>

				<p class="campo-form">
					<span>Todos os campos com o sinal * são obrigatórios</span> <br />
					<h:commandButton type="submit" name="salvar" class="submit"
						value="Salvar Alterações" id="salvar"
						action="#{disciplinaMB.doSalvarDisciplina(disciplinaMB.disciplina.id,disciplinaMB.disciplina.nome,disciplinaMB.disciplina.descricao,disciplinaMB.disciplina.numVagas,disciplinaMB.disciplina.mediaAprovacao,disciplinaMB.disciplina.horario, disciplinaMB.disciplina.dtInicio, disciplinaMB.disciplina.dtFim, disciplinaMB.profMinistranteId, disciplinaMB.disciplina.local,disciplinaMB.disciplina.semestre)}"
						update=":msg :editarDisciplinaAdmin"
						onclick="this.value='Salvando... ';">
					</h:commandButton>
					<h:commandButton type="submit" name="cancelar" class="submit"
						style="min-width:109px;" value="Cancelar" id="cancelar"
						action="#{disciplinaMB.doCancelar()}" immediate="true">
					</h:commandButton>
				</p>
			</h:form>
		</ui:define>
	</ui:composition>
</h:body>
</html>